import { model, Schema } from 'mongoose';
import { DictionaryItem } from '@/types/common/dictionary';

const DictionaryItemSchema = new Schema<DictionaryItem>(
  {
    label: { type: String, required: true },
    value: { type: String, required: true },
    backgroundColor: String,
    status: { type: Boolean, default: true },
    sort: { type: Number, default: 100 },
    remark: String,
  },
  { timestamps: { createdAt: true, updatedAt: true } },
);

export const DictionaryItemModel = model('DictionaryItem', DictionaryItemSchema);
